//
//  SAPrepareRegisteredVC.m
//  saasRetail
//
//  Created by mac on 2023/9/7.
//

#import "SAPrepareRegisteredVC.h"
#import "SARegisteredVC.h"

@interface SAPrepareRegisteredVC ()

@property (nonatomic, strong) UIButton *backBtn;

@end

@implementation SAPrepareRegisteredVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

-(void)clickedRegisteredBtn {
    SARegisteredVC *pushVC = [SARegisteredVC new];
    [self.navigationController pushViewController:pushVC animated:YES];
}

-(void)initUI {
    
    self.view.backgroundColor = kLineColor;
    
    UIImageView *topImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Login_top"]];
    topImageV.frame = SARectMake(0, 0, kBaseScreenWidth, 165 + DifferenceHeight);
    [self.view addSubview:topImageV];
    
    [self.view addSubview:self.backBtn];
    
    UILabel *tipLab = [[UILabel alloc] initWithFrame:SARectMake(24, 70 + DifferenceHeight, 200, 20)];
    tipLab.text = @"Hello!";
    tipLab.font = kBFont(18);
    tipLab.textColor = [UIColor whiteColor];
    tipLab.textAlignment = NSTextAlignmentLeft;
    [self.view  addSubview:tipLab];
    
    UILabel *tipLab2 = [[UILabel alloc] initWithFrame:SARectMake(24, 97 + DifferenceHeight, kBaseScreenWidth, 20)];
    tipLab2.text = @"欢迎注册衣点通";
    tipLab2.font = kBFont(18);
    tipLab2.textColor = [UIColor whiteColor];
    tipLab2.textAlignment = NSTextAlignmentLeft;
    [self.view  addSubview:tipLab2];
    
//    UIScrollView *whiteView = [[UIScrollView alloc] initWithFrame:SARectMake(15, 128 + DifferenceHeight, 345, 500)];
    UIScrollView *whiteView = [[UIScrollView alloc] initWithFrame:CGRectMake(kScaleNum(15), kScaleNum(128 + DifferenceHeight), kScaleNum(345), kScreenHeight - kScaleNum(138 + DifferenceHeight))];
    whiteView.backgroundColor = [UIColor whiteColor];
    whiteView.layer.cornerRadius = kScaleNum(5);
    whiteView.layer.masksToBounds = YES;
    whiteView.contentSize = CGSizeMake(kScaleNum(345), kScaleNum(606));
    [self.view addSubview:whiteView];
    
    UILabel *processLab = [[UILabel alloc] initWithFrame:SARectMake(10, 20, 200, 20)];
    processLab.text = @"注册流程";
    processLab.font = kFont(15);
    processLab.textColor = kBlackColor;
    processLab.textAlignment = NSTextAlignmentLeft;
    [whiteView  addSubview:processLab];
    
    UILabel *stepsLab = [[UILabel alloc] initWithFrame:SARectMake(10, 50, 300, 20)];
    stepsLab.text = @"第一步：注册账号密码  第二步：开通支付";
    stepsLab.font = kFont(13);
    stepsLab.textColor = kPinkColor;
    stepsLab.textAlignment = NSTextAlignmentLeft;
    [whiteView  addSubview:stepsLab];
    
    UILabel *prepareLab = [[UILabel alloc] initWithFrame:SARectMake(10, 80, 200, 20)];
    prepareLab.text = @"需准备如下资料";
    prepareLab.font = kFont(15);
    prepareLab.textColor = kBlackColor;
    prepareLab.textAlignment = NSTextAlignmentLeft;
    [whiteView  addSubview:prepareLab];
    
    UILabel *tipLab3 = [[UILabel alloc] initWithFrame:SARectMake(10, 110, 330, 20)];
    tipLab3.text = @"1、身份证正反面：需准备身份证正反面照片或原件。";
    tipLab3.font = kFont(13);
    tipLab3.textColor = kLightgGrayColor;
    tipLab3.textAlignment = NSTextAlignmentLeft;
    [whiteView  addSubview:tipLab3];
    
    UIImageView *positiveImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_card_positive"]];
    positiveImageV.frame = SARectMake(8, 140, 160, 111);
    positiveImageV.contentMode = UIViewContentModeScaleAspectFit;
    [whiteView addSubview:positiveImageV];
    
    UILabel *positiveTipLab = [[UILabel alloc] initWithFrame:SARectMake(8, 260, 160, 15)];
    positiveTipLab.text = @"上传身份证正面";
    positiveTipLab.textColor = kBlackColor;
    positiveTipLab.font = kFont(13);
    positiveTipLab.numberOfLines = 0;
    positiveTipLab.textAlignment = NSTextAlignmentCenter;
    [whiteView addSubview:positiveTipLab];
    
    UIImageView *reverseImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_card_reverse"]];
    reverseImageV.frame = SARectMake(177, 140, 160, 111);
    [whiteView addSubview:reverseImageV];
    reverseImageV.contentMode = UIViewContentModeScaleAspectFit;
    
    UILabel *reverseTipLab = [[UILabel alloc] initWithFrame:SARectMake(177, 260, 160, 15)];
    reverseTipLab.text = @"上传身份证反面";
    reverseTipLab.textColor = kBlackColor;
    reverseTipLab.font = kFont(13);
    reverseTipLab.numberOfLines = 0;
    reverseTipLab.textAlignment = NSTextAlignmentCenter;
    [whiteView addSubview:reverseTipLab];
    
    UILabel *tipLab4 = [[UILabel alloc] initWithFrame:SARectMake(10, 285, 330, 20)];
    tipLab4.text = @"2、银行卡照片：需准备银行卡照片 或原件。";
    tipLab4.font = kFont(13);
    tipLab4.textColor = kLightgGrayColor;
    tipLab4.textAlignment = NSTextAlignmentLeft;
    [whiteView  addSubview:tipLab4];
    
    UIImageView *cardImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pay_bankCard"]];
    cardImageV.frame = SARectMake(85, 315, 175, 99);
    cardImageV.userInteractionEnabled = YES;
    cardImageV.contentMode = UIViewContentModeScaleAspectFit;
    [whiteView addSubview:cardImageV];
    
    UILabel *tipLab5 = [[UILabel alloc] initWithFrame:SARectMake(10, 424, 330, 20)];
    tipLab5.text = @"3、真实经营照片：商户需准备门头照/内景照/收银台照。";
    tipLab5.font = kFont(13);
    tipLab5.textColor = kLightgGrayColor;
    tipLab5.textAlignment = NSTextAlignmentLeft;
    [whiteView  addSubview:tipLab5];
    
    for (int i = 0; i < 3; i++) {
        NSString *imageName = [NSString stringWithFormat:@"pay_shop_%d",i + 1];
        UIImageView *mainImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
        mainImageV.frame = SARectMake(23 + i * 107, 454, 84, 53);
        mainImageV.userInteractionEnabled = YES;
        mainImageV.contentMode = UIViewContentModeScaleAspectFit;
        mainImageV.backgroundColor = kColor(210, 210, 210, 1);
        [whiteView addSubview:mainImageV];
    }

    UIButton *registeredBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    registeredBtn.frame = SARectMake(60, 537, 225, 35);
    [registeredBtn setTitle:@"我准备好了，自行注册" forState:UIControlStateNormal];
    [registeredBtn setBackgroundImage:[UIImage imageNamed:@"Login_btn_1"] forState:UIControlStateNormal];
    [registeredBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    registeredBtn.titleLabel.font = kFont(15);
    [registeredBtn addTarget:self action:@selector(clickedRegisteredBtn) forControlEvents:UIControlEventTouchUpInside];
    [whiteView addSubview:registeredBtn];
}

- (UIButton *)backBtn {
    if (!_backBtn) {
        _backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_backBtn setImage:[UIImage imageNamed:@"whiteAllow"] forState:UIControlStateNormal];
        [_backBtn addTarget:self action:@selector(backToLastVC) forControlEvents:UIControlEventTouchUpInside];
        _backBtn.titleLabel.font = kFont(18);
        _backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        _backBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
        _backBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 15, 0, 0);
        _backBtn.frame = SARectMake(0, StatusHeight - 44, 60, 44);
    }
    return _backBtn;
}

@end
